package com.systop.supervise.mapper;
import com.systop.common.pojo.Teacher;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;
@Component
@Mapper
public interface TeacherMapper {
    /*
    * 修改teacher
    * Teacher teacher
    * return int
    * csh
    * */
    @Update("update teacher set password = #{password},name = #{name},professional = #{professional}, sex = #{sex},phone_url = #{phone_url},college_name = #{college_name},type = #{type},remark = #{remark}  where tno = #{tno}")
    int updataSupervice(Teacher teacher);


    //"time = #{time,jdbcType=TIMESTAMP} "  时间类型

    /*
     * 添加teacher
     * Teacher teacher
     * return int
     * csh
     * */
    @Insert("insert into teacher(tno,password,name,professional,sex,phone_url,college_name,type,remark) values (#{tno},#{password},#{name},#{professional},#{sex},#{phone_url},#{college_name},#{type},#{remark})")
    int insertSupervice(Teacher teacher);

    /*
     * 登陆
     * Teacher teacher
     * Teacher teacher
     * csh
     * */
    @Select("select * from teacher where tno = #{tno} and password= #{password}")
    Teacher TeacherLogin(Teacher teacher);

    /*
     * 查看全部
     * 无
     * list
     * csh
     * */
    @Select("select * from teacher")
    List<Teacher> teacherSupList();

    /*
     * 用tno查看teacher
     * String tno
     * list
     * csh
     * */
    @Select("select * from teacher where tno = #{tno}")
    List<Teacher> teacherSupteacher(String tno);

    /*
     * 删除teacher
     * string tno
     * return int
     * csh
     * */
    @Delete("delete from teacher where tno=#{tno}")
    int deleteTeacher(String tno);


}
